﻿using System;
namespace ConsoleApp
{
    interface IGraphic
    {
        double AreaCalculate();
    }
    class Rectangle : IGraphic
    {
        public double AreaCalculate()
        {
            return x * y;
        }
        public Rectangle(double x, double y)
        {
            this.x = x;
            this.y = y;
        }
        
        private double x;
        private double y;

    }
    class Circle : IGraphic
    {
        public double AreaCalculate()
        {
            return 3.14 * r * r;
        }
        public Circle(double r)
        {
            this.r = r;
        }

        private double r;
    }


        class work1
    {
        static void Main(string[] args)
        {
            double area = 0;
            for(int i=0;i<10;i++)
            {
                var rand = new Random();
                int j=rand.Next(0, 2);
                double x = rand.Next(1, 11);
                double y = rand.Next(1, 11);
                if(j==0)
                {
                    Rectangle rectangle = new Rectangle(x, y);
                    area += rectangle.AreaCalculate();
                    Console.WriteLine(area);
                }
                else
                {
                    Circle circle = new Circle(x);
                    area += circle.AreaCalculate();
                    Console.WriteLine(area);
                }
            }
            
            return;
            
        }
    }
}